<template>
	<view class="input-select">
		<uni-easyinput class="input" v-model="value" trim="both" :placeholder="placeholder" prefixIcon="search"
			:inputBorder="false" @input='onInput()' />
		<!-- <view class="button" @click="search">查 询</view> -->
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'

	const emit = defineEmits(['search'])
	const props = defineProps({
		placeholder: {
			type: String,
			default: '请输入人员姓名'
		},
	})
	const value = ref('')
	const timer = ref(null)

	const search = () => {
		emit('search', value.value)
	}
	const onInput = () => {
		clearTimeout(timer.value)
		timer.value = setTimeout(() => {
			emit('search', value.value)
		}, 500)

	}
</script>

<style lang="less">

</style>
<style lang="less" scoped>
	.input-select {
		display: flex;
		align-items: center;
		margin-bottom: 32rpx;
		background-color: #F5F5F5 !important;
		border-radius: 40rpx;
		overflow: hidden;

		.input {
			flex: 1;


		}

		// .button {
		// 	height: 50rpx;
		// 	width: 100rpx;
		// 	line-height: 50rpx;
		// 	margin-left: 10rpx;
		// 	font-size: 20rpx;
		// 	text-align: center;
		// 	background-color: #175DFF;
		// 	color: #FFFFFF;
		// 	border-radius: 40rpx;
		// }
	}
</style>